package ch.uzh.ifi.seal.ssqa.model.diagram.part;

import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;

import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.gmf.runtime.notation.View;

import ch.uzh.ifi.seal.ssqa.model.Diagram;
import ch.uzh.ifi.seal.ssqa.model.DiagramComponent;
import ch.uzh.ifi.seal.ssqa.model.DiagramComposite;
import ch.uzh.ifi.seal.ssqa.model.DiagramFolder;
import ch.uzh.ifi.seal.ssqa.model.DiagramModule;
import ch.uzh.ifi.seal.ssqa.model.DiagramVCom;
import ch.uzh.ifi.seal.ssqa.model.ModelPackage;
import ch.uzh.ifi.seal.ssqa.model.diagram.edit.parts.DiagramComposite2EditPart;
import ch.uzh.ifi.seal.ssqa.model.diagram.edit.parts.DiagramCompositeDiagramCompositeChildrenCompartment2EditPart;
import ch.uzh.ifi.seal.ssqa.model.diagram.edit.parts.DiagramCompositeDiagramCompositeChildrenCompartmentEditPart;
import ch.uzh.ifi.seal.ssqa.model.diagram.edit.parts.DiagramCompositeEditPart;
import ch.uzh.ifi.seal.ssqa.model.diagram.edit.parts.DiagramEditPart;
import ch.uzh.ifi.seal.ssqa.model.diagram.edit.parts.DiagramFolder2EditPart;
import ch.uzh.ifi.seal.ssqa.model.diagram.edit.parts.DiagramFolderDiagramFolderChildrenCompartment2EditPart;
import ch.uzh.ifi.seal.ssqa.model.diagram.edit.parts.DiagramFolderDiagramFolderChildrenCompartmentEditPart;
import ch.uzh.ifi.seal.ssqa.model.diagram.edit.parts.DiagramFolderEditPart;
import ch.uzh.ifi.seal.ssqa.model.diagram.edit.parts.DiagramModule2EditPart;
import ch.uzh.ifi.seal.ssqa.model.diagram.edit.parts.DiagramModuleDiagramModuleChildrenCompartment2EditPart;
import ch.uzh.ifi.seal.ssqa.model.diagram.edit.parts.DiagramModuleDiagramModuleChildrenCompartmentEditPart;
import ch.uzh.ifi.seal.ssqa.model.diagram.edit.parts.DiagramModuleEditPart;
import ch.uzh.ifi.seal.ssqa.model.diagram.edit.parts.DiagramVComEditPart;
import ch.uzh.ifi.seal.ssqa.model.diagram.providers.SsqaElementTypes;

/**
 * @generated
 */
public class SsqaDiagramUpdater {

	/**
	 * @generated
	 */
	public static List<SsqaNodeDescriptor> getSemanticChildren(View view) {
		switch (SsqaVisualIDRegistry.getVisualID(view)) {
		case DiagramEditPart.VISUAL_ID:
			return getDiagram_1000SemanticChildren(view);
		case DiagramFolderDiagramFolderChildrenCompartmentEditPart.VISUAL_ID:
			return getDiagramFolderDiagramFolderChildrenCompartment_7001SemanticChildren(view);
		case DiagramFolderDiagramFolderChildrenCompartment2EditPart.VISUAL_ID:
			return getDiagramFolderDiagramFolderChildrenCompartment_7002SemanticChildren(view);
		case DiagramModuleDiagramModuleChildrenCompartmentEditPart.VISUAL_ID:
			return getDiagramModuleDiagramModuleChildrenCompartment_7003SemanticChildren(view);
		case DiagramCompositeDiagramCompositeChildrenCompartmentEditPart.VISUAL_ID:
			return getDiagramCompositeDiagramCompositeChildrenCompartment_7004SemanticChildren(view);
		case DiagramModuleDiagramModuleChildrenCompartment2EditPart.VISUAL_ID:
			return getDiagramModuleDiagramModuleChildrenCompartment_7005SemanticChildren(view);
		case DiagramCompositeDiagramCompositeChildrenCompartment2EditPart.VISUAL_ID:
			return getDiagramCompositeDiagramCompositeChildrenCompartment_7006SemanticChildren(view);
		}
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<SsqaNodeDescriptor> getDiagram_1000SemanticChildren(
			View view) {
		if (!view.isSetElement()) {
			return Collections.emptyList();
		}
		Diagram modelElement = (Diagram) view.getElement();
		LinkedList<SsqaNodeDescriptor> result = new LinkedList<SsqaNodeDescriptor>();
		for (Iterator<?> it = modelElement.getComponents().iterator(); it
				.hasNext();) {
			DiagramComponent childElement = (DiagramComponent) it.next();
			int visualID = SsqaVisualIDRegistry.getNodeVisualID(view,
					childElement);
			if (visualID == DiagramFolderEditPart.VISUAL_ID) {
				result.add(new SsqaNodeDescriptor(childElement, visualID));
				continue;
			}
			if (visualID == DiagramModuleEditPart.VISUAL_ID) {
				result.add(new SsqaNodeDescriptor(childElement, visualID));
				continue;
			}
			if (visualID == DiagramCompositeEditPart.VISUAL_ID) {
				result.add(new SsqaNodeDescriptor(childElement, visualID));
				continue;
			}
		}
		return result;
	}

	/**
	 * @generated
	 */
	public static List<SsqaNodeDescriptor> getDiagramFolderDiagramFolderChildrenCompartment_7001SemanticChildren(
			View view) {
		if (false == view.eContainer() instanceof View) {
			return Collections.emptyList();
		}
		View containerView = (View) view.eContainer();
		if (!containerView.isSetElement()) {
			return Collections.emptyList();
		}
		DiagramFolder modelElement = (DiagramFolder) containerView.getElement();
		LinkedList<SsqaNodeDescriptor> result = new LinkedList<SsqaNodeDescriptor>();
		for (Iterator<?> it = modelElement.getChildren().iterator(); it
				.hasNext();) {
			DiagramComponent childElement = (DiagramComponent) it.next();
			int visualID = SsqaVisualIDRegistry.getNodeVisualID(view,
					childElement);
			if (visualID == DiagramFolder2EditPart.VISUAL_ID) {
				result.add(new SsqaNodeDescriptor(childElement, visualID));
				continue;
			}
			if (visualID == DiagramModule2EditPart.VISUAL_ID) {
				result.add(new SsqaNodeDescriptor(childElement, visualID));
				continue;
			}
			if (visualID == DiagramComposite2EditPart.VISUAL_ID) {
				result.add(new SsqaNodeDescriptor(childElement, visualID));
				continue;
			}
		}
		return result;
	}

	/**
	 * @generated
	 */
	public static List<SsqaNodeDescriptor> getDiagramFolderDiagramFolderChildrenCompartment_7002SemanticChildren(
			View view) {
		if (false == view.eContainer() instanceof View) {
			return Collections.emptyList();
		}
		View containerView = (View) view.eContainer();
		if (!containerView.isSetElement()) {
			return Collections.emptyList();
		}
		DiagramFolder modelElement = (DiagramFolder) containerView.getElement();
		LinkedList<SsqaNodeDescriptor> result = new LinkedList<SsqaNodeDescriptor>();
		for (Iterator<?> it = modelElement.getChildren().iterator(); it
				.hasNext();) {
			DiagramComponent childElement = (DiagramComponent) it.next();
			int visualID = SsqaVisualIDRegistry.getNodeVisualID(view,
					childElement);
			if (visualID == DiagramFolder2EditPart.VISUAL_ID) {
				result.add(new SsqaNodeDescriptor(childElement, visualID));
				continue;
			}
			if (visualID == DiagramModule2EditPart.VISUAL_ID) {
				result.add(new SsqaNodeDescriptor(childElement, visualID));
				continue;
			}
			if (visualID == DiagramComposite2EditPart.VISUAL_ID) {
				result.add(new SsqaNodeDescriptor(childElement, visualID));
				continue;
			}
		}
		return result;
	}

	/**
	 * @generated
	 */
	public static List<SsqaNodeDescriptor> getDiagramModuleDiagramModuleChildrenCompartment_7003SemanticChildren(
			View view) {
		if (false == view.eContainer() instanceof View) {
			return Collections.emptyList();
		}
		View containerView = (View) view.eContainer();
		if (!containerView.isSetElement()) {
			return Collections.emptyList();
		}
		DiagramModule modelElement = (DiagramModule) containerView.getElement();
		LinkedList<SsqaNodeDescriptor> result = new LinkedList<SsqaNodeDescriptor>();
		for (Iterator<?> it = modelElement.getChildren().iterator(); it
				.hasNext();) {
			DiagramComponent childElement = (DiagramComponent) it.next();
			int visualID = SsqaVisualIDRegistry.getNodeVisualID(view,
					childElement);
			if (visualID == DiagramFolder2EditPart.VISUAL_ID) {
				result.add(new SsqaNodeDescriptor(childElement, visualID));
				continue;
			}
			if (visualID == DiagramModule2EditPart.VISUAL_ID) {
				result.add(new SsqaNodeDescriptor(childElement, visualID));
				continue;
			}
			if (visualID == DiagramComposite2EditPart.VISUAL_ID) {
				result.add(new SsqaNodeDescriptor(childElement, visualID));
				continue;
			}
		}
		return result;
	}

	/**
	 * @generated
	 */
	public static List<SsqaNodeDescriptor> getDiagramCompositeDiagramCompositeChildrenCompartment_7004SemanticChildren(
			View view) {
		if (false == view.eContainer() instanceof View) {
			return Collections.emptyList();
		}
		View containerView = (View) view.eContainer();
		if (!containerView.isSetElement()) {
			return Collections.emptyList();
		}
		DiagramComposite modelElement = (DiagramComposite) containerView
				.getElement();
		LinkedList<SsqaNodeDescriptor> result = new LinkedList<SsqaNodeDescriptor>();
		for (Iterator<?> it = modelElement.getChildren().iterator(); it
				.hasNext();) {
			DiagramComponent childElement = (DiagramComponent) it.next();
			int visualID = SsqaVisualIDRegistry.getNodeVisualID(view,
					childElement);
			if (visualID == DiagramFolder2EditPart.VISUAL_ID) {
				result.add(new SsqaNodeDescriptor(childElement, visualID));
				continue;
			}
			if (visualID == DiagramModule2EditPart.VISUAL_ID) {
				result.add(new SsqaNodeDescriptor(childElement, visualID));
				continue;
			}
			if (visualID == DiagramComposite2EditPart.VISUAL_ID) {
				result.add(new SsqaNodeDescriptor(childElement, visualID));
				continue;
			}
		}
		return result;
	}

	/**
	 * @generated
	 */
	public static List<SsqaNodeDescriptor> getDiagramModuleDiagramModuleChildrenCompartment_7005SemanticChildren(
			View view) {
		if (false == view.eContainer() instanceof View) {
			return Collections.emptyList();
		}
		View containerView = (View) view.eContainer();
		if (!containerView.isSetElement()) {
			return Collections.emptyList();
		}
		DiagramModule modelElement = (DiagramModule) containerView.getElement();
		LinkedList<SsqaNodeDescriptor> result = new LinkedList<SsqaNodeDescriptor>();
		for (Iterator<?> it = modelElement.getChildren().iterator(); it
				.hasNext();) {
			DiagramComponent childElement = (DiagramComponent) it.next();
			int visualID = SsqaVisualIDRegistry.getNodeVisualID(view,
					childElement);
			if (visualID == DiagramFolder2EditPart.VISUAL_ID) {
				result.add(new SsqaNodeDescriptor(childElement, visualID));
				continue;
			}
			if (visualID == DiagramModule2EditPart.VISUAL_ID) {
				result.add(new SsqaNodeDescriptor(childElement, visualID));
				continue;
			}
			if (visualID == DiagramComposite2EditPart.VISUAL_ID) {
				result.add(new SsqaNodeDescriptor(childElement, visualID));
				continue;
			}
		}
		return result;
	}

	/**
	 * @generated
	 */
	public static List<SsqaNodeDescriptor> getDiagramCompositeDiagramCompositeChildrenCompartment_7006SemanticChildren(
			View view) {
		if (false == view.eContainer() instanceof View) {
			return Collections.emptyList();
		}
		View containerView = (View) view.eContainer();
		if (!containerView.isSetElement()) {
			return Collections.emptyList();
		}
		DiagramComposite modelElement = (DiagramComposite) containerView
				.getElement();
		LinkedList<SsqaNodeDescriptor> result = new LinkedList<SsqaNodeDescriptor>();
		for (Iterator<?> it = modelElement.getChildren().iterator(); it
				.hasNext();) {
			DiagramComponent childElement = (DiagramComponent) it.next();
			int visualID = SsqaVisualIDRegistry.getNodeVisualID(view,
					childElement);
			if (visualID == DiagramFolder2EditPart.VISUAL_ID) {
				result.add(new SsqaNodeDescriptor(childElement, visualID));
				continue;
			}
			if (visualID == DiagramModule2EditPart.VISUAL_ID) {
				result.add(new SsqaNodeDescriptor(childElement, visualID));
				continue;
			}
			if (visualID == DiagramComposite2EditPart.VISUAL_ID) {
				result.add(new SsqaNodeDescriptor(childElement, visualID));
				continue;
			}
		}
		return result;
	}

	/**
	 * @generated
	 */
	public static List<SsqaLinkDescriptor> getContainedLinks(View view) {
		switch (SsqaVisualIDRegistry.getVisualID(view)) {
		case DiagramEditPart.VISUAL_ID:
			return getDiagram_1000ContainedLinks(view);
		case DiagramFolderEditPart.VISUAL_ID:
			return getDiagramFolder_2001ContainedLinks(view);
		case DiagramModuleEditPart.VISUAL_ID:
			return getDiagramModule_2002ContainedLinks(view);
		case DiagramCompositeEditPart.VISUAL_ID:
			return getDiagramComposite_2003ContainedLinks(view);
		case DiagramFolder2EditPart.VISUAL_ID:
			return getDiagramFolder_3001ContainedLinks(view);
		case DiagramModule2EditPart.VISUAL_ID:
			return getDiagramModule_3002ContainedLinks(view);
		case DiagramComposite2EditPart.VISUAL_ID:
			return getDiagramComposite_3003ContainedLinks(view);
		case DiagramVComEditPart.VISUAL_ID:
			return getDiagramVCom_4001ContainedLinks(view);
		}
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<SsqaLinkDescriptor> getIncomingLinks(View view) {
		switch (SsqaVisualIDRegistry.getVisualID(view)) {
		case DiagramFolderEditPart.VISUAL_ID:
			return getDiagramFolder_2001IncomingLinks(view);
		case DiagramModuleEditPart.VISUAL_ID:
			return getDiagramModule_2002IncomingLinks(view);
		case DiagramCompositeEditPart.VISUAL_ID:
			return getDiagramComposite_2003IncomingLinks(view);
		case DiagramFolder2EditPart.VISUAL_ID:
			return getDiagramFolder_3001IncomingLinks(view);
		case DiagramModule2EditPart.VISUAL_ID:
			return getDiagramModule_3002IncomingLinks(view);
		case DiagramComposite2EditPart.VISUAL_ID:
			return getDiagramComposite_3003IncomingLinks(view);
		case DiagramVComEditPart.VISUAL_ID:
			return getDiagramVCom_4001IncomingLinks(view);
		}
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<SsqaLinkDescriptor> getOutgoingLinks(View view) {
		switch (SsqaVisualIDRegistry.getVisualID(view)) {
		case DiagramFolderEditPart.VISUAL_ID:
			return getDiagramFolder_2001OutgoingLinks(view);
		case DiagramModuleEditPart.VISUAL_ID:
			return getDiagramModule_2002OutgoingLinks(view);
		case DiagramCompositeEditPart.VISUAL_ID:
			return getDiagramComposite_2003OutgoingLinks(view);
		case DiagramFolder2EditPart.VISUAL_ID:
			return getDiagramFolder_3001OutgoingLinks(view);
		case DiagramModule2EditPart.VISUAL_ID:
			return getDiagramModule_3002OutgoingLinks(view);
		case DiagramComposite2EditPart.VISUAL_ID:
			return getDiagramComposite_3003OutgoingLinks(view);
		case DiagramVComEditPart.VISUAL_ID:
			return getDiagramVCom_4001OutgoingLinks(view);
		}
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<SsqaLinkDescriptor> getDiagram_1000ContainedLinks(
			View view) {
		Diagram modelElement = (Diagram) view.getElement();
		LinkedList<SsqaLinkDescriptor> result = new LinkedList<SsqaLinkDescriptor>();
		result.addAll(getContainedTypeModelFacetLinks_DiagramVCom_4001(modelElement));
		return result;
	}

	/**
	 * @generated
	 */
	public static List<SsqaLinkDescriptor> getDiagramFolder_2001ContainedLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<SsqaLinkDescriptor> getDiagramModule_2002ContainedLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<SsqaLinkDescriptor> getDiagramComposite_2003ContainedLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<SsqaLinkDescriptor> getDiagramFolder_3001ContainedLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<SsqaLinkDescriptor> getDiagramModule_3002ContainedLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<SsqaLinkDescriptor> getDiagramComposite_3003ContainedLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<SsqaLinkDescriptor> getDiagramVCom_4001ContainedLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<SsqaLinkDescriptor> getDiagramFolder_2001IncomingLinks(
			View view) {
		DiagramFolder modelElement = (DiagramFolder) view.getElement();
		Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences = EcoreUtil.CrossReferencer
				.find(view.eResource().getResourceSet().getResources());
		LinkedList<SsqaLinkDescriptor> result = new LinkedList<SsqaLinkDescriptor>();
		result.addAll(getIncomingTypeModelFacetLinks_DiagramVCom_4001(
				modelElement, crossReferences));
		return result;
	}

	/**
	 * @generated
	 */
	public static List<SsqaLinkDescriptor> getDiagramModule_2002IncomingLinks(
			View view) {
		DiagramModule modelElement = (DiagramModule) view.getElement();
		Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences = EcoreUtil.CrossReferencer
				.find(view.eResource().getResourceSet().getResources());
		LinkedList<SsqaLinkDescriptor> result = new LinkedList<SsqaLinkDescriptor>();
		result.addAll(getIncomingTypeModelFacetLinks_DiagramVCom_4001(
				modelElement, crossReferences));
		return result;
	}

	/**
	 * @generated
	 */
	public static List<SsqaLinkDescriptor> getDiagramComposite_2003IncomingLinks(
			View view) {
		DiagramComposite modelElement = (DiagramComposite) view.getElement();
		Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences = EcoreUtil.CrossReferencer
				.find(view.eResource().getResourceSet().getResources());
		LinkedList<SsqaLinkDescriptor> result = new LinkedList<SsqaLinkDescriptor>();
		result.addAll(getIncomingTypeModelFacetLinks_DiagramVCom_4001(
				modelElement, crossReferences));
		return result;
	}

	/**
	 * @generated
	 */
	public static List<SsqaLinkDescriptor> getDiagramFolder_3001IncomingLinks(
			View view) {
		DiagramFolder modelElement = (DiagramFolder) view.getElement();
		Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences = EcoreUtil.CrossReferencer
				.find(view.eResource().getResourceSet().getResources());
		LinkedList<SsqaLinkDescriptor> result = new LinkedList<SsqaLinkDescriptor>();
		result.addAll(getIncomingTypeModelFacetLinks_DiagramVCom_4001(
				modelElement, crossReferences));
		return result;
	}

	/**
	 * @generated
	 */
	public static List<SsqaLinkDescriptor> getDiagramModule_3002IncomingLinks(
			View view) {
		DiagramModule modelElement = (DiagramModule) view.getElement();
		Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences = EcoreUtil.CrossReferencer
				.find(view.eResource().getResourceSet().getResources());
		LinkedList<SsqaLinkDescriptor> result = new LinkedList<SsqaLinkDescriptor>();
		result.addAll(getIncomingTypeModelFacetLinks_DiagramVCom_4001(
				modelElement, crossReferences));
		return result;
	}

	/**
	 * @generated
	 */
	public static List<SsqaLinkDescriptor> getDiagramComposite_3003IncomingLinks(
			View view) {
		DiagramComposite modelElement = (DiagramComposite) view.getElement();
		Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences = EcoreUtil.CrossReferencer
				.find(view.eResource().getResourceSet().getResources());
		LinkedList<SsqaLinkDescriptor> result = new LinkedList<SsqaLinkDescriptor>();
		result.addAll(getIncomingTypeModelFacetLinks_DiagramVCom_4001(
				modelElement, crossReferences));
		return result;
	}

	/**
	 * @generated
	 */
	public static List<SsqaLinkDescriptor> getDiagramVCom_4001IncomingLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<SsqaLinkDescriptor> getDiagramFolder_2001OutgoingLinks(
			View view) {
		DiagramFolder modelElement = (DiagramFolder) view.getElement();
		LinkedList<SsqaLinkDescriptor> result = new LinkedList<SsqaLinkDescriptor>();
		result.addAll(getOutgoingTypeModelFacetLinks_DiagramVCom_4001(modelElement));
		return result;
	}

	/**
	 * @generated
	 */
	public static List<SsqaLinkDescriptor> getDiagramModule_2002OutgoingLinks(
			View view) {
		DiagramModule modelElement = (DiagramModule) view.getElement();
		LinkedList<SsqaLinkDescriptor> result = new LinkedList<SsqaLinkDescriptor>();
		result.addAll(getOutgoingTypeModelFacetLinks_DiagramVCom_4001(modelElement));
		return result;
	}

	/**
	 * @generated
	 */
	public static List<SsqaLinkDescriptor> getDiagramComposite_2003OutgoingLinks(
			View view) {
		DiagramComposite modelElement = (DiagramComposite) view.getElement();
		LinkedList<SsqaLinkDescriptor> result = new LinkedList<SsqaLinkDescriptor>();
		result.addAll(getOutgoingTypeModelFacetLinks_DiagramVCom_4001(modelElement));
		return result;
	}

	/**
	 * @generated
	 */
	public static List<SsqaLinkDescriptor> getDiagramFolder_3001OutgoingLinks(
			View view) {
		DiagramFolder modelElement = (DiagramFolder) view.getElement();
		LinkedList<SsqaLinkDescriptor> result = new LinkedList<SsqaLinkDescriptor>();
		result.addAll(getOutgoingTypeModelFacetLinks_DiagramVCom_4001(modelElement));
		return result;
	}

	/**
	 * @generated
	 */
	public static List<SsqaLinkDescriptor> getDiagramModule_3002OutgoingLinks(
			View view) {
		DiagramModule modelElement = (DiagramModule) view.getElement();
		LinkedList<SsqaLinkDescriptor> result = new LinkedList<SsqaLinkDescriptor>();
		result.addAll(getOutgoingTypeModelFacetLinks_DiagramVCom_4001(modelElement));
		return result;
	}

	/**
	 * @generated
	 */
	public static List<SsqaLinkDescriptor> getDiagramComposite_3003OutgoingLinks(
			View view) {
		DiagramComposite modelElement = (DiagramComposite) view.getElement();
		LinkedList<SsqaLinkDescriptor> result = new LinkedList<SsqaLinkDescriptor>();
		result.addAll(getOutgoingTypeModelFacetLinks_DiagramVCom_4001(modelElement));
		return result;
	}

	/**
	 * @generated
	 */
	public static List<SsqaLinkDescriptor> getDiagramVCom_4001OutgoingLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	private static Collection<SsqaLinkDescriptor> getContainedTypeModelFacetLinks_DiagramVCom_4001(
			Diagram container) {
		LinkedList<SsqaLinkDescriptor> result = new LinkedList<SsqaLinkDescriptor>();
		for (Iterator<?> links = container.getLinks().iterator(); links
				.hasNext();) {
			EObject linkObject = (EObject) links.next();
			if (false == linkObject instanceof DiagramVCom) {
				continue;
			}
			DiagramVCom link = (DiagramVCom) linkObject;
			if (DiagramVComEditPart.VISUAL_ID != SsqaVisualIDRegistry
					.getLinkWithClassVisualID(link)) {
				continue;
			}
			DiagramComponent dst = link.getTarget();
			DiagramComponent src = link.getSource();
			result.add(new SsqaLinkDescriptor(src, dst, link,
					SsqaElementTypes.DiagramVCom_4001,
					DiagramVComEditPart.VISUAL_ID));
		}
		return result;
	}

	/**
	 * @generated
	 */
	private static Collection<SsqaLinkDescriptor> getIncomingTypeModelFacetLinks_DiagramVCom_4001(
			DiagramComponent target,
			Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences) {
		LinkedList<SsqaLinkDescriptor> result = new LinkedList<SsqaLinkDescriptor>();
		Collection<EStructuralFeature.Setting> settings = crossReferences
				.get(target);
		for (EStructuralFeature.Setting setting : settings) {
			if (setting.getEStructuralFeature() != ModelPackage.eINSTANCE
					.getDiagramVCom_Target()
					|| false == setting.getEObject() instanceof DiagramVCom) {
				continue;
			}
			DiagramVCom link = (DiagramVCom) setting.getEObject();
			if (DiagramVComEditPart.VISUAL_ID != SsqaVisualIDRegistry
					.getLinkWithClassVisualID(link)) {
				continue;
			}
			DiagramComponent src = link.getSource();
			result.add(new SsqaLinkDescriptor(src, target, link,
					SsqaElementTypes.DiagramVCom_4001,
					DiagramVComEditPart.VISUAL_ID));
		}
		return result;
	}

	/**
	 * @generated
	 */
	private static Collection<SsqaLinkDescriptor> getOutgoingTypeModelFacetLinks_DiagramVCom_4001(
			DiagramComponent source) {
		Diagram container = null;
		// Find container element for the link.
		// Climb up by containment hierarchy starting from the source
		// and return the first element that is instance of the container class.
		for (EObject element = source; element != null && container == null; element = element
				.eContainer()) {
			if (element instanceof Diagram) {
				container = (Diagram) element;
			}
		}
		if (container == null) {
			return Collections.emptyList();
		}
		LinkedList<SsqaLinkDescriptor> result = new LinkedList<SsqaLinkDescriptor>();
		for (Iterator<?> links = container.getLinks().iterator(); links
				.hasNext();) {
			EObject linkObject = (EObject) links.next();
			if (false == linkObject instanceof DiagramVCom) {
				continue;
			}
			DiagramVCom link = (DiagramVCom) linkObject;
			if (DiagramVComEditPart.VISUAL_ID != SsqaVisualIDRegistry
					.getLinkWithClassVisualID(link)) {
				continue;
			}
			DiagramComponent dst = link.getTarget();
			DiagramComponent src = link.getSource();
			if (src != source) {
				continue;
			}
			result.add(new SsqaLinkDescriptor(src, dst, link,
					SsqaElementTypes.DiagramVCom_4001,
					DiagramVComEditPart.VISUAL_ID));
		}
		return result;
	}

}
